package com.hshoesmall.demo.controller;

import com.hshoesmall.demo.common.api.ApiResult;
import com.hshoesmall.demo.mapper.DetailMapper;
import com.hshoesmall.demo.model.entity.Detail;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.websocket.server.PathParam;
import java.util.List;

//查询出来的数据会被渲染成json
@RestController
@RequestMapping("/detail")//接口路经(不能重复)
public class DetailController {

    @Resource//引入mapper数据查询接口
    DetailMapper detailMapper;

    @PostMapping
    public ApiResult<List<Detail>>  getDetail(){
        List<Detail> detailList= detailMapper.findAll();
//        System.out.println("sid = );
        return ApiResult.success(detailList) ;
    }

}
